package com.ccx.library.study;

public class Adaptee {
    public void request(){
        System.out.println("connection network");
    }
    public void HDMI(){
        System.out.println("HDMI");
    }
}

// 接口转换
interface netToUsb{
    // 网线=》usb
    void RequestHandler();
}

class Adapter extends Adaptee implements netToUsb{

    @Override
    public void RequestHandler() {
        super.request(); // 上网
    }
}

class Adapter2 extends Adaptee implements netToUsb{

    @Override
    public void RequestHandler() {
        super.HDMI();
    }
}

// 上网实现
class Computer{

    public void net(netToUsb net){
        // 转接头
        net.RequestHandler();
    }

    public static void main(String[] args) {
        Computer computer = new Computer();
        Adapter adapter = new Adapter();
        computer.net(adapter);
        Adapter2 adapter2 = new Adapter2();
        computer.net(adapter2);
    }

}